/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.baladaboa.ws.core;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Leone
 */
@Entity
@Table(name = "sugestoes", catalog = "dbbaladaboa", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sugestoes.findAll", query = "SELECT s FROM Sugestoes s"),
    @NamedQuery(name = "Sugestoes.findByIdsugestoes", query = "SELECT s FROM Sugestoes s WHERE s.idsugestoes = :idsugestoes"),
    @NamedQuery(name = "Sugestoes.findByDataSugestao", query = "SELECT s FROM Sugestoes s WHERE s.dataSugestao = :dataSugestao")})
public class Sugestoes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idsugestoes", nullable = false)
    private Integer idsugestoes;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 2147483647)
    @Column(name = "descricao", nullable = false, length = 2147483647)
    private String descricao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "data_sugestao", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dataSugestao;
    @JoinColumn(name = "casa_idcasa", referencedColumnName = "idcasa")
    @ManyToOne
    private Casa casaIdcasa;
    @JoinColumn(name = "usuario_idusuario", referencedColumnName = "idusuario")
    @ManyToOne
    private Usuario usuarioIdusuario;

    public Sugestoes() {
    }

    public Sugestoes(Integer idsugestoes) {
        this.idsugestoes = idsugestoes;
    }

    public Sugestoes(Integer idsugestoes, String descricao, Date dataSugestao) {
        this.idsugestoes = idsugestoes;
        this.descricao = descricao;
        this.dataSugestao = dataSugestao;
    }

    public Integer getIdsugestoes() {
        return idsugestoes;
    }

    public void setIdsugestoes(Integer idsugestoes) {
        this.idsugestoes = idsugestoes;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Date getDataSugestao() {
        return dataSugestao;
    }

    public void setDataSugestao(Date dataSugestao) {
        this.dataSugestao = dataSugestao;
    }

    public Casa getCasaIdcasa() {
        return casaIdcasa;
    }

    public void setCasaIdcasa(Casa casaIdcasa) {
        this.casaIdcasa = casaIdcasa;
    }

    public Usuario getUsuarioIdusuario() {
        return usuarioIdusuario;
    }

    public void setUsuarioIdusuario(Usuario usuarioIdusuario) {
        this.usuarioIdusuario = usuarioIdusuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsugestoes != null ? idsugestoes.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sugestoes)) {
            return false;
        }
        Sugestoes other = (Sugestoes) object;
        if ((this.idsugestoes == null && other.idsugestoes != null) || (this.idsugestoes != null && !this.idsugestoes.equals(other.idsugestoes))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.baladaboa.ws.core.Sugestoes[ idsugestoes=" + idsugestoes + " ]";
    }
    
}
